<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<meta name="description" content="">
		<meta name="author" content="">

		<title>Dashboard Template for Bootstrap</title>
		<!-- Bootstrap core CSS -->
		<link href="asserts/css/bootstrap.min.css" rel="stylesheet">

		<!-- Custom styles for this template -->
		<link href="asserts/css/dashboard.css" rel="stylesheet">
	</head>

	<body>

	<div th:insert="common/bar::top"></div>

		<div class="container-fluid">
			<div class="row">
				<div th:insert="common/bar::#left"></div>
				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<div class="table-responsive">
						<div class="form-group">
							<label>举报单号：</label>
							<input type="text" class="form-control" th:value="${session.appealSupervise.superviseID}" disabled>
						</div>
						<div class="form‐group">
							<label>电动车牌照：</label>
							<input type="email" class="form-control" th:value="${session.appealSupervise.ebickID}" disabled>
						</div>
						<div class="form-group">
							<label>被举报时间</label><br/>
							<input type="email" class="form-control" th:value="${session.appealSupervise.dateandtime}" disabled>
						</div>
						<div class="form-group">
							<label>详情</label><br/>
							<input type="email" class="form-control" th:value="${session.appealSupervise.details}" disabled>
						</div>
						<div class="form-group">
							<label>照片</label><br/>
							<img th:src="${session.appealSupervise.image}">
						</div>
						<form id="myForm">
							<div class="form‐group">
								<label>申诉理由</label>
								<input type="text" class="form-control" name="appealReason" th:placeholder="理由">
							</div>
						</form>
						<button type="submit" class="btn btn-primary" onclick="mysubmit()">提交</button>
					</div>
				</main>
			</div>
		</div>
	<script type="text/javascript" src="asserts/js/jquery-3.2.1.slim.min.js"></script>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script src="asserts/js/popper.min.js"></script>
	<script src="asserts/js/feather.min.js"></script>
	<script src="asserts/js/bootstrap.min.js"></script>
	<script type="text/javascript">

		function verifyLoginStatus() {
			//验证登录状态
			console.log("1");
			var message = document.getElementById("mystatus").innerText;
			console.log(message);
			if(message == '请先登录'){
				alert("请登录");
				location.href="login";
				return '1';
			}
			return '2';
		}

		//表单提交
		function mysubmit() {

			var status = verifyLoginStatus();

			if(status == '2'){
				var form = new FormData(document.getElementById("myForm"));

				$.ajax({
					url:"uploadAppeal.do",
					type:"post",
					dataType:"html",
					data:form,
					cache:false,
					processData:false,
					contentType:false,
					success: function (data) {
						console.log("success");
						alert("提交成功，等待验证");
						location.href="showSuperviseMe.do";
					},
					error:function (data) {
						console.log("error");
					}
				})
			}

		}



	</script>
	</body>

</html>